
.gallery-wrapper {
  position: fixed;;
  padding-top: $topbar-height;
  width: 100%;
  height: 100vh;
}
.page {
  position: absolute;
  width: 100%;
  height: 100%;
}
.toc {
  width: 240px;
  height: 100%;
  background: #fff;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 2px 0 4px rgba(0,0,0,0.15);
  z-index: 1;
  transition: all 300ms;
  white-space: nowrap;

  >div {
    padding-top: 20px;
    padding-bottom: 80px;
  }
  .subpages {
    transition: max-height 0.3s;
    overflow: hidden;
  }
  li {
    list-style: none;
    line-height: 40px;
  }
  a {
    display: block;
  }
  .link {
    padding-left: 28px;
    color: $black-20;
    background: transparent;
    border-style: solid;
    border-width: 0 0 0 4px;
    border-color: transparent;
  }
  .link.active {
    color: $primary;
    font-weight: bold;
    border-color: $primary;
    @include linearGradientV(border-image, $primary, $secondary);
    border-image-slice: 2;
  }
  .link:hover {
    color: $white-40;
  }
  .list-header {
    position: relative;
    font-weight: 700;
    font-size: 0.833em;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 24px 0 8px 24px;
    color: $white-40;
  }
  .list-header:not(.active):not(.expanded):before {
    content: '+';
    font-weight: 700;
    color: $white-40;
    position: absolute;
    top: 24px;
    right: 8px;
    font-size: 16px;
    line-height: 18px;
  }
  .list-header:not(.active):not(.expanded) + .subpages {
    max-height: 0 !important;
  }
}
.markdown-body {
  padding: 40px 36px 96px;
}
.stat {
  text-transform: uppercase;
  font-size: 0.833em;

  b {
    display: block;
    font-size: 3em;
  }
}
.tooltip {
  position: absolute;
  padding: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  max-width: 300px;
  font-size: 10px;
  z-index: 9;
  pointer-events: none;
}
.options-panel {
  width: 284px;
  background: #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
  margin: 24px;
  padding: 12px 24px;
  position: absolute;
  top: 0;
  right: 0;
  outline: none;
  cursor: auto;

  hr {
    margin: 12px -24px;
  }
  .source-link {
    text-align: right;
    margin-top: 8px;

    a {
      font-weight: bold;
      color: $black-40;
      font-size: 11px;
    }
  }
  .input {
    position: relative;
    width: 100%;

    >* {
      vertical-align: middle;
      white-space: nowrap;
    }
    label {
      text-transform: uppercase;
      display: inline-block;
      width: 50%;
      margin-right: 10%;
      color: $black-40;
      margin-bottom: 4px;
    }
    input, a {
      font-size: 0.9em;
      display: inline-block;
      padding: 0 4px;
      width: 40%;
      height: 20px;
      line-height: 1.833;
    }
    input[type="checkbox"], input[type="radio"], input[type="color"] {
      width: 20%;
    }
    input {
      border: solid 1px #ccc;

      &:disabled {
        background: $white;
      }
      &[type="checkbox"] {
        height: auto;
      }
    }

    .tooltip {
      left: 50%;
      top: 24px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 200ms;
    }
    &:hover .tooltip {
      opacity: 1;
    }
  }
  h3 {
    font-size: 1.2em;
    font-weight: 500;
    margin: 8px 0;
  }

  a {
    display: inline;
  }

  p {
    margin-bottom: 16px;
  }
  .legend {
    display: inline-block;
    width: 12px;
    height: 12px;
  }
}
code {
  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace !important;
}
.demo {
  position: relative;
  overflow: hidden !important;
  height: 100vh;
  transition: height 600ms ease-in;
}
.markdown {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.markdown .demo {
  height: 80vh;

  >div:first-child {
    margin-top: 0;
    transition: margin-top 600ms ease-in;
  }

  &:not(:hover) {
    height: 30vh;
    min-height: 200px;
    transition: height 300ms;

    >div:first-child {
      margin-top: -20vh;
      transition: margin-top 300ms;
    }
    .options-panel {
      .input, hr {
        display: none;
      }
    }
  }
}

@media (max-width: 576px) {
  .flexbox--row {
    display: block;
  }
  .toc {
    position: absolute;
    width: 100vw;
    height: 0;
    z-index: 9;

    >div {
      padding-top: 128px;
    }
  }
  .toc.open {
    height: 100%;
  }
  .options-panel {
    width: 100%;
    margin: 0;
  }
  .options-panel:not(.focus) {
    cursor: pointer;
    >div > *, hr, .input {
      display: none;
    }
    >div:before {
      position: absolute;
      top: 12px;
      right: 12px;
      color: $white-40;
      font-size: 24px;
      font-family: 'deckgl';
      content: "\e906";
    }
    h3 {
      display: block;
    }
  }
  .tabs .tip {
    display: none;
  }
  .markdown-body {
    padding: 40px 12px 96px;
  }
}
